
package cz.czu.pef.DataModelling.ejb.impl;

import java.util.logging.*;

import javax.ejb.*;

import cz.czu.pef.DataModelling.dao.DaoBasic;
import cz.czu.pef.DataModelling.domainObjects.Address;
import cz.czu.pef.DataModelling.ejb.api.*;
import cz.czu.pef.DataModelling.service.api.*;
import cz.czu.pef.DataModelling.utils.SpringLoader;

@Stateless(name = "addressEJB", mappedName = "addressEJB")
@Remote
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class AddressEjbImpl extends AbstractEjbImpl<Address> implements AddressEjbInterface
{
  Logger logger = Logger.getLogger(AddressEjbImpl.class.getName());

  AddressService addressService;

  @Override
  public DaoBasic<Address> getDaoBasic()
  {
    addressService = SpringLoader.getContext().getBean(AddressService.class);
    return addressService;
  }

  @Override
  public boolean canBeRemoved(Address entity)
  {
    addressService = SpringLoader.getContext().getBean(AddressService.class);
    return addressService.canBeRemoved(entity);
  }

}
